package com.ceam.orderservice;

import com.sun.tools.example.debug.tty.MessageOutput;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.integration.annotation.IntegrationComponentScan;
import org.springframework.integration.support.MessageBuilder;

@EnableBinding(MessageOutput.class)
@IntegrationComponentScan
public class MyMessageProducer {

    private final MessageOutput messageOutput;

    public MyMessageProducer(MessageOutput messageOutput) {
        this.messageOutput = messageOutput;
    }

    public void sendMessage(String messagePayload) {
        messageOutput.output().send(MessageBuilder.withPayload(messagePayload).build());
    }
}
